import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class FirstPage extends StatefulWidget{

//  @override
//  State<StatefulWidget> createState() {
//
//    return new FirstPageState();
//  }

  @override
  FirstPageState createState() => FirstPageState();

}

class FirstPageState extends State<FirstPage>{
  @override
  Widget build(BuildContext context) {

    return new Scaffold(
//      appBar: new AppBar(
//
//        title: new Text('界面1')
//
//      ),
      body: new SingleChildScrollView(

        child: new Column(

          children: <Widget>[

            // 条形进度条
            new LinearProgressIndicator(
              backgroundColor: Colors.blue,
              // value: 0.2,
              valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
            ),
            new Container(padding: const EdgeInsets.all(20.0)),
            // 圆形进度条
            new CircularProgressIndicator(
              strokeWidth: 4.0,
              backgroundColor: Colors.blue,
              // value: 0.2,
              valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
            ),

            new Text('第一'),
            new Text('第二'),
            new Text('第三'),

            new Text('聆听璇律', style: new TextStyle(inherit: true),),
            //color颜色--fontSize字体大小--fontWeight粗细
            new Text('李一桐黄蓉',
              style: new TextStyle(color: Colors.red,
                  fontSize: 18.0,
                  fontWeight: FontWeight.w800),
            ),
            //fontStyle斜体
            new Text('陆雪琪', style: new TextStyle(
                fontSize: 18.0, fontStyle: FontStyle.italic)),
            //letterSpacing字符间距
            new Text('三十年河东，三十年河西。莫欺少年穷！',
              style: new TextStyle(letterSpacing: 10.0),),
            //单词间距
            new Text('i hit you',
              style: new TextStyle(wordSpacing: 30.0),),
            new Text('七里香textBaseline',
              //style: new TextStyle(textBaseline: TextBaseline.alphabetic),)
              style: new TextStyle(textBaseline: TextBaseline.ideographic),),
            //'height: 用在Text控件上的时候，会乘以fontSize做为行高,
            new Text('夜空中最亮的星',
              style: new TextStyle(height: 2.0),),
            //decoration和decorationStyle
            new Text(
                '烟花易冷', style: new TextStyle(
                decoration: TextDecoration.lineThrough,
                decorationStyle: TextDecorationStyle.wavy)),

            new Column(

              children: <Widget>[

                new Container(

                  padding: const EdgeInsets.all(15.0),
                  child: new Text('  百度百科是百度公司推出的一部内容开放、自由的网络百科全书平台。其测试版于2006年4月20日上线，正式版在2008年4月21日发布，截至2018年2月，百度百科已经收录了超过1520万词条，参与词条编辑的网友超过644万人，几乎涵盖了所有已知的知识领域。\n  “世界很复杂，百度更懂你”，百度百科旨在创造一个涵盖各领域知识的中文信息收集平台。百度百科强调用户的参与和奉献精神，充分调动互联网用户的力量，汇聚上亿用户的头脑智慧，积极进行交流和分享。同时，百度百科实现与百度搜索、百度知道的结合，从不同的层次上满足用户对信息的需求。',
                      textAlign: TextAlign.left,
                      softWrap: true,
                      overflow: TextOverflow.fade,
                      style: new TextStyle(
                        color: Colors.red,
                        letterSpacing: 5,
                        wordSpacing: 5,
                        fontSize: 15.0,
                      )

                  ),

                ),

                new Container(

                  padding: const EdgeInsets.all(15.0),
                  margin: const EdgeInsets.fromLTRB(30, 10, 10, 10),
                  child: new Text('三十年河东，三十年河西。莫欺少年穷！',
                    style: new TextStyle(letterSpacing: 10.0),
                  ),

                ),

                new Text('第二',
                  maxLines: 1,

                ),
                new Text('第三',
                  maxLines: 1,

                ),

              ],

            ),

            new Row(

              mainAxisAlignment:MainAxisAlignment.end ,

              children: [
                new Icon(Icons.star_border, color: Colors.red[500],semanticLabel: '哈哈哈',textDirection: TextDirection.ltr),
                new Icon(Icons.star_border, color: Colors.red[500]),
                new Icon(Icons.star_border, color: Colors.red[500]),
                new Icon(Icons.star_border, color: Colors.grey[300]),
                new Icon(Icons.star_border, color: Colors.grey[300]),
              ],
            ),

          ],

        ),

      ),

      floatingActionButton: new FloatingActionButton(
        foregroundColor: Colors.red,
        backgroundColor: Colors.grey,
        tooltip: 'Add', // used by assistive technologies
        child: new Icon(Icons.add),
        onPressed: (){

          Fluttertoast.showToast(
              msg: "你点击了floatingActionButton",
              toastLength: Toast.LENGTH_SHORT,
              gravity: ToastGravity.CENTER,
              timeInSecForIos: 1,
              backgroundColor: Colors.blue,
              textColor: Colors.white
          );

        },
      ),

    );
  }

}